.NET Framework Class Library |
ParallelEnumerable..::.ThenBy<(Of <(TSource, TKey>)>) Method (OrderedParallelQuery<(Of <(TSource>)>), Func<(Of <(TSource, TKey>)>), IComparer<(Of <(TKey>)>)) |
ParallelEnumerable Class See Also Send Feedback |
Performs in parallel a subsequent ordering of the elements in a sequence in
ascending order by using a specified comparer.
Namespace:
System.Linq
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function ThenBy(Of TSource, TKey) ( _ source As OrderedParallelQuery(Of TSource), _ keySelector As Func(Of TSource, TKey), _ comparer As IComparer(Of TKey) _ ) As OrderedParallelQuery(Of TSource) |
C# |
---|
public static OrderedParallelQuery<TSource> ThenBy<TSource, TKey>( OrderedParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer ) |
Parameters
- source
- Type: System.Linq..::.OrderedParallelQuery<(Of <(TSource>)>)
An OrderedParallelQuery{TSource} that contains elements to sort.
- keySelector
- Type: System..::.Func<(Of <(TSource, TKey>)>)
A function to extract a key from an element.
- comparer
- Type: System.Collections.Generic..::.IComparer<(Of <(TKey>)>)
An IComparer{TKey} to compare keys.
Type Parameters
- TSource
- The type of elements of source.
- TKey
- The type of the key returned by keySelector.
Return Value
An OrderedParallelQuery{TSource} whose elements are sorted according to a key.Remarks
In contrast to the sequential implementation, this is not a stable sort.
See the remarks for OrderBy(ParallelQuery{TSource}, Func{TSource,TKey}) for
an approach to implementing a stable sort.
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | source or keySelector is a null reference (Nothing in Visual Basic). |